******************************************************************
**************"Taxing the Wealthy in Haiti"***********************
*******Authors: Ana I. Lopez Garcia & Sarah Berens****************
******************************************************************

******************************************************************
*Data Preparation 
*1. Independent Variables
*1a. Demographic and Socioeconomic Variables
*1b. Migration-related Variables
*1c. Crime and gang-related Variables
*1d. Time / context related Variables
*2. Experiment 1 - Conjoint

*******************************************************************
* Set working directory
use "haiti_apr.dta", clear

*******************************************************************
*1. INDEPENDENT VARIABLES
*1a. Demographic and Socioeconomic Variables

*Gender
gen female = 0
replace female = 1 if gender == "female"
label variable female "female" 
label define female 0 "male" 1 "female", modify
label values female female

*Age
gen age_cat = 0 if age_group == "18_24"
replace age_cat = 1 if age_group == "25_34"
replace age_cat = 2 if age_group == "35_44"
replace age_cat = 3 if age_group == "45_54"
replace age_cat = 4 if age_group == "55_64"
replace age_cat = 5 if age_group == "65_and_over"
label define age_cat 0 "18-24 yrs" 1"25-34 yrs" 2"35-44 yrs" 3"45-54 yrs" 4"55-64 yrs" 5"+65 yrs", modify
label values age_cat age_cat 

*Class
gen class_ident = 0
replace class_ident = 1 if (q15_belonging == "lower_middle_class")
replace class_ident = 2 if (q15_belonging == "middle_class")
replace class_ident = 3 if (q15_belonging == "upper_middle_class")
replace class_ident = 4 if (q15_belonging == "upper_class")
replace class_ident = . if (q15_belonging == "")
label define class_ident 0 "Lower" 1"Lower middle" 2"Middle" 3"Upper middle" 4"Upper", modify
label values class_ident class_ident
label variable class_ident "Class identification" 

*Income 
gen income = 1
replace income = 2 if (q16_household_income == "between_2501_5000_gourdes")
replace income = 3 if (q16_household_income == "between_5001_9000_gourdes")
replace income = 4 if ( q16_household_income == "between_9001_11000_gourdes")
replace income = 5 if ( q16_household_income == "between_11001_14000_gourdes")
replace income = 6 if ( q16_household_income == "between_14001_16000_gourdes")
replace income = 7 if ( q16_household_income == "between_16001_20000_gourdes")
replace income = 8 if ( q16_household_income == "between_20001_35000_gourdes")
replace income = 9 if ( q16_household_income == "between_35001_70000_gourdes")
replace income = 10 if ( q16_household_income == "more_than_70000_gourdes")
replace income = . if ( q16_household_income == "")
label variable income "income" 
recode income 1/2 = 0 3/5= 1 6/10= 2, gen(income_cat3)
label variable income_cat3 "income three categories" 
label define income_cat3 0 "<5000 gourdes" 1 "between 5000-14000 gourdes" 2 "> 14000 gourdes", modify
label values income_cat3 income_cat3 

*Education 
gen education = .
replace education = 1 if (q08_education == "none")
replace education = 2 if (q08_education == "primary_incomplete")
replace education = 3 if (q08_education == "primary_complete")
replace education = 4 if (q08_education == "secondary_incomplete")
replace education = 5 if (q08_education == "secondary_complete")
replace education = 6 if (q08_education == "technical_school_incomplete")
replace education = 7 if (q08_education == "technical_school_complete")
replace education = 8 if (q08_education == "university_incomplete")
replace education = 9 if (q08_education == "university_complete")
label variable education "education level"
label define education 1 "none" 2"primary_incomplete" 3"primary_complete"  4"secondary_incomplete" 5"secondary_complete" 6"technical_school_incomplete" ///
	7 "technical_school_complete" 8 "university_incomplete" 9 "university_complete", modify
label values education education
tab education, gen(edlevel)
recode education 1/6=0 7/9=1, gen(high_school_higher)
label variable high_school_higher "high school or higher" 
recode education 1/7=0 8/9=1, gen(university)
label variable university "university educated" 

label define university 1 "university educated" 0 "lower educated" , modify
label values university university


*Civil status
gen civil_status = 0 
replace civil_status = 1 if ( q09_civil_status == "common_law_marriage" | q09_civil_status == "married")
replace civil_status = . if  q09_civil_status == ""
label variable civil_status "Civil status" 
label define civil_status 1 "married or in a partnership" 0 "single, divorced or widowed" 
label values civil_status civil_status

*Employment status
gen employed = 0
replace employed = 1 if (q10_employment_status == "employed_contri_to_pension" | q10_employment_status == "employed_not_contri_to_pension" |  q10_employment_status == "self_emp_contri_to_pension" | q10_employment_status == "self_emp_not_contri_to_pension")
replace employed = . if q10_employment_status == ""
label variable employed "employed"
label define employed  1 "employed or working" 0 "unemployed or not working" 
label values employed  employed 

*Race
gen race = 0 
replace race = 1 if (q11_race == "black")
replace race = . if (q11_race == "")
label variable race "race"
label define race  1 "black" 0 "mulatto, white, other" 
label values race race 

*Property ownership
gen owned_land = 0
replace owned_land = 1 if (q07_house == "owned_land" | q07_house == "owned_land_and_dwelling" | q07_house == "occupied_without_paying_rent" )
label variable owned_land "property taxpayer"

***********************************************************************
*1b. MIGRATION
*Migrant
gen migrant = 0
replace migrant = 1 if q06_living == "another_country"
replace migrant = . if ((q06_living == ""))
label variable migrant "former migrant" 

*Long residence 
gen residence_long = 1 if q06_living == "same_municipality"
replace residence_long = 0 if (q06_living == "another_municipality" | q06_living == "another_country")
label variable residence_long "resident in the same municipality" 

*Migrant household
gen migrant_house = 1 
replace migrant_house = 0 if (q12_relatives_living_abroad == "no")
replace migrant_house = . if (q12_relatives_living_abroad == "")
label variable migrant_house "relatives living abroad" 
label define migrant_house 0 "nonmigrant HH" 1 "migrant HH" 
label values migrant_house migrant_house 

*Relatives living in the USA
gen migrant_usa = migrant_house 
replace migrant_usa = 0 if (q12_relatives_living_abroad == "yes_in_other_countries")
replace migrant_usa = . if (q12_relatives_living_abroad == "")
label variable migrant_usa "relatives living in the US" 
label define migrant_usa 0 "no relatives in the US" 1 "relatives in the US" 
label values migrant_usa migrant_usa

*Remittances 
gen remittances = 0
replace remittances = 1 if ( q13_dependent_on_remittance == "a_lot" | q13_dependent_on_remittance == "little" |  q13_dependent_on_remittance == "some")
replace remittances = . if q13_dependent_on_remittance == ""
label variable remittances "remittance receiving HH"
label define remittances 0 "nonrecipient" 1 "remittance recipient" 
label values remittances remittances 

*Remittances(cont)
gen remittances_cont = 0
replace remittances_cont = 0 if q13_dependent_on_remittance == "nothing"
replace remittances_cont = 1 if q13_dependent_on_remittance == "little"
replace remittances_cont = 2 if q13_dependent_on_remittance == "some"
replace remittances_cont = 3 if q13_dependent_on_remittance == "a_lot"
label variable remittances_cont "remittance dependence" 
label define remittances_cont 0 "nothing" 1 "a litte" 2 "somewhat" 3 "a lot", modify
label values remittances_cont remittances_cont 

*Migrant intentions
gen migrant_intent = 0
replace migrant_intent = 1 if ( q14_intentions_moving_abroad == "yes")
replace migrant_intent = . if ( q14_intentions_moving_abroad == "")
label variable migrant_intent "emigration intentions"
label define migrant_intent 0 "no intentions" 1 "emigration intentions" 
label values migrant_intent migrant_intent 


********************************************************************
*1c. Security and Gangs
**Crime 
gen victim = 0
replace victim = 1 if q17_crime_victim == "yes"
replace victim = . if q17_crime_victim == ""
label define victim 0 "nonvictim" 1 "victim", modify
label values victim victim
label variable victim "Victimization" 

*Feelings of insecurity
gen unsafe = 0
replace unsafe = 1 if (q18_safety_in_neighborhood == "somewhat_unsafe" | q18_safety_in_neighborhood == "very_unsafe")
replace unsafe = . if (q18_safety_in_neighborhood == "")
label variable unsafe "Unsafe neighbourhood"
label define unsafe 0 "(somewhat and very) safe" 1 "(somewhat and very) unsafe", modify
label values unsafe unsafe 

*Feelings of insecurity (cont)
gen unsafe_cont = 0
replace unsafe_cont = 0 if q18_safety_in_neighborhood == "very_unsafe"
replace unsafe_cont = 1 if q18_safety_in_neighborhood == "somewhat_unsafe"
replace unsafe_cont = 2 if q18_safety_in_neighborhood == "somewhat_safe"
replace unsafe_cont = 3 if q18_safety_in_neighborhood == "very safe"
label variable unsafe_cont "Feelings of safety in neighbourhood" 
label define unsafe_cont 0 "very unsafe" 1 "somewhat unsafe" 2 "somewhat safe" 3 "very safe", modify
label values unsafe_cont unsafe_cont 

*Gang presence (binary)
gen gang = 0
replace gang = 1 if (q19_affected_by_gangs == "a_little" | q19_affected_by_gangs == "somewhat" | q19_affected_by_gangs == "a_lot")
replace gang = . if (q19_affected_by_gangs == "")
label variable gang "Gang presence in neighbourhood" 
label define gang 0 "no gang presence" 1 "gang presence", modify
label values gang gang

*Gang presence (cont)
gen gang_cont = 0
replace gang_cont = 0 if q19_affected_by_gangs == "none"
replace gang_cont = 1 if q19_affected_by_gangs == "a_little"
replace gang_cont = 2 if q19_affected_by_gangs == "somewhat"
replace gang_cont = 3 if q19_affected_by_gangs == "a_lot"
label variable gang_cont "Gang presence in neighbourhood" 
label define gang_cont 0 "none" 1 "a litte" 2 "somewhat" 3 "a lot", modify
label values gang_cont gang_cont 

*Gang presence (binary)
gen gang2 = 0
replace gang2 = 1 if (q19_affected_by_gangs == "somewhat" | q19_affected_by_gangs == "a_lot")
replace gang2 = . if (q19_affected_by_gangs == "")
label variable gang2 "Gang presence in neighbourhood" 
label define gang2 0 "no gang presence" 2 "gang presence", modify
label values gang2 gang2

************************************************************
*1d. Time / date variables
gen year = 0 if date_num < 20240000
replace year = 1 if date_num >=20240000 
label variable year "Year" 
label define year 0 "2023" 1 "2024", modify
label values year year 

*MONTH
gen month = 0 if date_num < 20240000
replace month = 1 if (date_num >=20240000 & date_num <20240200)
replace month = 2 if (date_num >=20240200 & date_num <20240300)
replace month = 3 if (date_num >=20240300 & date_num <20240400)
replace month = 4 if (date_num >=20240400)
label define month 0 "Dec 2023" 1 "Jan 2024" 2 "Feb 2024" 3 "March 2024" 4 "April 2024", modify
label values month month 

**15day
gen fifteenday = 0 if date_num < 20240000
replace fifteenday = 1 if (date_num >=20240000 & date_num <20240115)
replace fifteenday = 2 if (date_num >=20240115 & date_num <20240200)
replace fifteenday = 3 if (date_num >=20240200 & date_num <20240215)
replace fifteenday = 4 if (date_num >=20240215 & date_num <20240300)
replace fifteenday = 5 if (date_num >=20240300 & date_num <20240315)
replace fifteenday = 6 if (date_num >=20240315 & date_num <20240400)
replace fifteenday = 7 if (date_num >=20240400)
label define fifteenday 0 "12-31 Dec 2023" 1 "1-14 Jan 2024"  2 "15-31 Jan 2024" 3 "1-14 Feb 2024" 4 "15-29 Feb 2024" 5 "1-14 March 2024" 6 "15-31 March 2024" 7 "1-15 April 2024", modify
label values fifteenday fifteenday 

***Days 
gen days = .
replace days = (date_num - 20231212) if month == 0
replace days = (date_num - 20240101) if month == 1
replace days = (date_num - 20240201) if month == 2
replace days = (date_num - 20240301) if month == 3
replace days = (date_num - 20240401) if month == 4
replace days = days + 20 if month == 1
replace days = days + 51 if month == 2
replace days = days + 80 if month == 3
replace days = days + 111 if month == 4
label variable days "Days since start of the survey"


*PRESIDENTIAL REMOVAL / GANG INSURRECTION
gen president = 0 if month < 3
replace president = 1 if month >= 3
label variable president "President faced gang upheaval" 
label define president 0 "Before upheaval" 1 "After upheaval", modify
label values president president

gen president_7a = 0 if date_num < 20240307 
replace president_7a = 1 if date_num >= 20240307 
label variable president_7a "7 days after president faced gang upheaval"

gen president_7 = 0 if date_num < 20240221
replace president_7 = 1 if date_num >= 20240221
label variable president_7 "7 days before president faced gang upheaval"

gen president_14 = 0 if date_num < 20240214
replace president_14 = 1 if date_num >= 20240214
label variable president_14 "15 days before president faced gang upheaval"


gen president_14a = 0 if date_num < 20240314 
replace president_14a = 1 if date_num >= 20240314 
label variable president_14a "14 days after president faced gang upheaval"


* Create time running variable where 0 corresponds to the day after the gang insurrection (March 2)
gen timezero = .
replace timezero = 0 if date_num == 20240302
replace timezero = date_num - 20240302


* Creating treatment and control variables for the day of the gang insurrection (March 1)

gen treatment_gang = . 

replace treatment_gang = 0 if date_num < 20240301
replace treatment_gang = 1 if date_num >= 20240301
replace treatment_gang = . if date_num == .
tab date treatment_gang, m		

* 14 days either side of gang insurrection 
gen treatment_fourteen = . 
replace treatment_fourteen = 0 if date_num > 20240214 & date_num < 20240301
replace treatment_fourteen = 1 if date_num > 20240301 & date_num < 20240315
tab date treatment_fourteen, m	
	
		
* 20 days either side of gang insurrection 
gen treatment_twenty = . 
replace treatment_twenty = 0 if fecha > 20240210 & fecha < 20240301
replace treatment_twenty = 1 if fecha > 20240301 & fecha < 20240320
tab date treatment_twenty, m	
	
*Time outliers 
gen time_outliers = 0
replace time_outliers = 1 if dwell_time_total >=  12088


save "haiti_apr_clean.dta", replace 


************************************************************
*2. CONJOINT EXPERIMENT
generate id = _n

*2.1 Dependent Variable (Experiment 1) 
gen evaluation_a_1 =  1 if (q01_tax_evaluation_t01 == "a")
gen evaluation_b_1 =  1 if (q01_tax_evaluation_t01 == "b")
replace evaluation_b_1 =  0 if (q01_tax_evaluation_t01 == "a")
replace evaluation_a_1 =  0 if (q01_tax_evaluation_t01 == "b")

gen evaluation_a_2 =  1 if (q02_tax_evaluation_t02 == "a")
gen evaluation_b_2 =  1 if (q02_tax_evaluation_t02 == "b")
replace evaluation_b_2 =  0 if (q02_tax_evaluation_t02 == "a")
replace evaluation_a_2 =  0 if (q02_tax_evaluation_t02 == "b")

gen evaluation_a_3 =  1 if (q03_tax_evaluation_t03 == "a")
gen evaluation_b_3 =  1 if (q03_tax_evaluation_t03 == "b")
replace evaluation_b_3 =  0 if (q03_tax_evaluation_t03 == "a")
replace evaluation_a_3 =  0 if (q03_tax_evaluation_t03 == "b")

*VIGNETTE 1 - TAX AUTHORITY
gen admin_a_1 = 0 if q01_c1_administers == "central_govt"
replace admin_a_1 = 1 if q01_c1_administers == "municipal_govt"
gen admin_b_1 = 0 if q01_c2_administers == "central_govt"
replace admin_b_1 = 1 if q01_c2_administers == "municipal_govt"

gen admin_a_2 = 0 if q02_c1_administers == "central_govt"
replace admin_a_2 = 1 if q02_c1_administers == "municipal_govt"
gen admin_b_2 = 0 if q02_c2_administers == "central_govt"
replace admin_b_2 = 1 if q02_c2_administers == "municipal_govt"

gen admin_a_3 = 0 if q03_c1_administers == "central_govt"
replace admin_a_3 = 1 if q03_c1_administers == "municipal_govt"
gen admin_b_3 = 0 if q03_c2_administers == "central_govt"
replace admin_b_3 = 1 if q03_c2_administers == "municipal_govt"


**VIGNETTE - TAX COLLECTION 
gen collects_a_1  = 0 if q01_c1_collects == "govt_officers_bureaucrats"
replace collects_a_1  = 1 if q01_c1_collects == "community_leaders_chiefs"
replace collects_a_1  = 2 if q01_c1_collects == "local_church_workers"
replace collects_a_1  = 3 if q01_c1_collects == "local_ngos"
replace collects_a_1  = 4 if q01_c1_collects == "foreign_donors_ngos"

gen collects_b_1  = 0 if q01_c2_collects == "govt_officers_bureaucrats"
replace collects_b_1  = 1 if q01_c2_collects == "community_leaders_chiefs"
replace collects_b_1  = 2 if q01_c2_collects == "local_church_workers"
replace collects_b_1  = 3 if q01_c2_collects == "local_ngos"
replace collects_b_1  = 4 if q01_c2_collects == "foreign_donors_ngos"

gen collects_a_2 = 0 if q02_c1_collects == "govt_officers_bureaucrats"
replace collects_a_2 = 1 if q02_c1_collects == "community_leaders_chiefs"
replace collects_a_2 = 2 if q02_c1_collects == "local_church_workers"
replace collects_a_2 = 3 if q02_c1_collects == "local_ngos"
replace collects_a_2 = 4 if q02_c1_collects == "foreign_donors_ngos"

gen collects_b_2 = 0 if q02_c2_collects == "govt_officers_bureaucrats"
replace collects_b_2 = 1 if q02_c2_collects == "community_leaders_chiefs"
replace collects_b_2 = 2 if q02_c2_collects == "local_church_workers"
replace collects_b_2 = 3 if q02_c2_collects == "local_ngos"
replace collects_b_2 = 4 if q02_c2_collects == "foreign_donors_ngos"

gen collects_a_3 = 0 if q03_c1_collects == "govt_officers_bureaucrats"
replace collects_a_3 = 1 if q03_c1_collects == "community_leaders_chiefs"
replace collects_a_3 = 2 if q03_c1_collects == "local_church_workers"
replace collects_a_3 = 3 if q03_c1_collects == "local_ngos"
replace collects_a_3 = 4 if q03_c1_collects == "foreign_donors_ngos"

gen collects_b_3 = 0 if q03_c2_collects == "govt_officers_bureaucrats"
replace collects_b_3 = 1 if q03_c2_collects == "community_leaders_chiefs"
replace collects_b_3 = 2 if q03_c2_collects == "local_church_workers"
replace collects_b_3 = 3 if q03_c2_collects == "local_ngos"
replace collects_b_3 = 4 if q03_c2_collects == "foreign_donors_ngos"


*VIGNETTE 3 - TAX EARMARKS
gen purpose_a_1 = 0 if q01_c1_purpose == "education_healthcare"
replace purpose_a_1 = 1 if q01_c1_purpose == "public_security"
replace purpose_a_1 = 2 if q01_c1_purpose == "transportation_roads"
replace purpose_a_1 = 3 if q01_c1_purpose == "waste_collection"
replace purpose_a_1 = 4 if q01_c1_purpose == "water_sanitation"

gen purpose_b_1 = 0 if q01_c2_purpose == "education_healthcare"
replace purpose_b_1 = 1 if q01_c2_purpose == "public_security"
replace purpose_b_1 = 2 if q01_c2_purpose == "transportation_roads"
replace purpose_b_1 = 3 if q01_c2_purpose == "waste_collection"
replace purpose_b_1 = 4 if q01_c2_purpose == "water_sanitation"

gen purpose_a_2 = 0 if q02_c1_purpose == "education_healthcare"
replace purpose_a_2 = 1 if q02_c1_purpose == "public_security"
replace purpose_a_2 = 2 if q02_c1_purpose == "transportation_roads"
replace purpose_a_2 = 3 if q02_c1_purpose == "waste_collection"
replace purpose_a_2 = 4 if q02_c1_purpose == "water_sanitation"

gen purpose_b_2 = 0 if q02_c2_purpose == "education_healthcare"
replace purpose_b_2 = 1 if q02_c2_purpose == "public_security"
replace purpose_b_2 = 2 if q02_c2_purpose == "transportation_roads"
replace purpose_b_2 = 3 if q02_c2_purpose == "waste_collection"
replace purpose_b_2 = 4 if q02_c2_purpose == "water_sanitation"

gen purpose_a_3 = 0 if q03_c1_purpose == "education_healthcare"
replace purpose_a_3 = 1 if q03_c1_purpose == "public_security"
replace purpose_a_3 = 2 if q03_c1_purpose == "transportation_roads"
replace purpose_a_3 = 3 if q03_c1_purpose == "waste_collection"
replace purpose_a_3 = 4 if q03_c1_purpose == "water_sanitation"

gen purpose_b_3 = 0 if q03_c2_purpose == "education_healthcare"
replace purpose_b_3 = 1 if q03_c2_purpose == "public_security"
replace purpose_b_3 = 2 if q03_c2_purpose == "transportation_roads"
replace purpose_b_3 = 3 if q03_c2_purpose == "waste_collection"
replace purpose_b_3 = 4 if q03_c2_purpose == "water_sanitation"


*VIGNETTE 4 - TIME RESULTS
gen improvement_a_1 = 0 if q01_c1_improvement == "immediately"
replace improvement_a_1 = 1 if q01_c1_improvement == "1_year"
replace improvement_a_1 = 2 if q01_c1_improvement == "2_years"
replace improvement_a_1 = 3 if q01_c1_improvement == "5_years"
replace improvement_a_1 = 4 if q01_c1_improvement == "10_years"

gen improvement_b_1 = 0 if q01_c2_improvement == "immediately"
replace improvement_b_1 = 1 if q01_c2_improvement == "1_year"
replace improvement_b_1 = 2 if q01_c2_improvement == "2_years"
replace improvement_b_1 = 3 if q01_c2_improvement == "5_years"
replace improvement_b_1 = 4 if q01_c2_improvement == "10_years"

gen improvement_a_2 = 0 if q02_c1_improvement == "immediately"
replace improvement_a_2 = 1 if q02_c1_improvement == "1_year"
replace improvement_a_2 = 2 if q02_c1_improvement == "2_years"
replace improvement_a_2 = 3 if q02_c1_improvement == "5_years"
replace improvement_a_2 = 4 if q02_c1_improvement == "10_years"

gen improvement_b_2 = 0 if q02_c2_improvement == "immediately"
replace improvement_b_2 = 1 if q02_c2_improvement == "1_year"
replace improvement_b_2 = 2 if q02_c2_improvement == "2_years"
replace improvement_b_2 = 3 if q02_c2_improvement == "5_years"
replace improvement_b_2 = 4 if q02_c2_improvement == "10_years"

gen improvement_a_3 = 0 if q03_c1_improvement == "immediately"
replace improvement_a_3 = 1 if q03_c1_improvement == "1_year"
replace improvement_a_3 = 2 if q03_c1_improvement == "2_years"
replace improvement_a_3 = 3 if q03_c1_improvement == "5_years"
replace improvement_a_3 = 4 if q03_c1_improvement == "10_years"

gen improvement_b_3 = 0 if q03_c2_improvement == "immediately"
replace improvement_b_3 = 1 if q03_c2_improvement == "1_year"
replace improvement_b_3 = 2 if q03_c2_improvement == "2_years"
replace improvement_b_3 = 3 if q03_c2_improvement == "5_years"
replace improvement_b_3 = 4 if q03_c2_improvement == "10_years"


*VIGNETTE 4 - TAX BENEFICIARY

gen beneficiary_a_1 = 0 if q01_c1_beneficiary == "extremely_poor"
replace beneficiary_a_1 = 1 if q01_c1_beneficiary == "low_income"
replace beneficiary_a_1 = 2 if q01_c1_beneficiary == "low_low_middle_class"
replace beneficiary_a_1 = 3 if q01_c1_beneficiary == "low_middle_class"
replace beneficiary_a_1 = 4 if q01_c1_beneficiary == "everyone"

gen beneficiary_b_1 = 0 if q01_c2_beneficiary == "extremely_poor"
replace beneficiary_b_1 = 1 if q01_c2_beneficiary == "low_income"
replace beneficiary_b_1 = 2 if q01_c2_beneficiary == "low_low_middle_class"
replace beneficiary_b_1 = 3 if q01_c2_beneficiary == "low_middle_class"
replace beneficiary_b_1 = 4 if q01_c2_beneficiary == "everyone"

gen beneficiary_a_2 = 0 if q02_c1_beneficiary == "extremely_poor"
replace beneficiary_a_2 = 1 if q02_c1_beneficiary == "low_income"
replace beneficiary_a_2 = 2 if q02_c1_beneficiary == "low_low_middle_class"
replace beneficiary_a_2 = 3 if q02_c1_beneficiary == "low_middle_class"
replace beneficiary_a_2 = 4 if q02_c1_beneficiary == "everyone"

gen beneficiary_b_2 = 0 if q02_c2_beneficiary == "extremely_poor"
replace beneficiary_b_2 = 1 if q02_c2_beneficiary == "low_income"
replace beneficiary_b_2 = 2 if q02_c2_beneficiary == "low_low_middle_class"
replace beneficiary_b_2 = 3 if q02_c2_beneficiary == "low_middle_class"
replace beneficiary_b_2 = 4 if q02_c2_beneficiary == "everyone"

gen beneficiary_a_3 = 0 if q03_c1_beneficiary == "extremely_poor"
replace beneficiary_a_3 = 1 if q03_c1_beneficiary == "low_income"
replace beneficiary_a_3 = 2 if q03_c1_beneficiary == "low_low_middle_class"
replace beneficiary_a_3 = 3 if q03_c1_beneficiary == "low_middle_class"
replace beneficiary_a_3 = 4 if q03_c1_beneficiary == "everyone"

gen beneficiary_b_3 = 0 if q03_c2_beneficiary == "extremely_poor"
replace beneficiary_b_3 = 1 if q03_c2_beneficiary == "low_income"
replace beneficiary_b_3 = 2 if q03_c2_beneficiary == "low_low_middle_class"
replace beneficiary_b_3 = 3 if q03_c2_beneficiary == "low_middle_class"
replace beneficiary_b_3 = 4 if q03_c2_beneficiary == "everyone"


*VIGNETTE 5 - SOCIAL RECOGNITION
gen recognition_a_1 = 0 if q01_c1_recognition == "none"
replace recognition_a_1 = 1 if q01_c1_recognition == "recognition_seals_pasted"
replace recognition_a_1 = 2 if q01_c1_recognition == "plaque_honour"
replace recognition_a_1 = 3 if q01_c1_recognition == "names_announced_local_radio"
replace recognition_a_1 = 4 if q01_c1_recognition == "names_local_paper_social_media"

gen recognition_b_1 = 0 if q01_c2_recognition == "none"
replace recognition_b_1 = 1 if q01_c2_recognition == "recognition_seals_pasted"
replace recognition_b_1 = 2 if q01_c2_recognition == "plaque_honour"
replace recognition_b_1 = 3 if q01_c2_recognition == "names_announced_local_radio"
replace recognition_b_1 = 4 if q01_c2_recognition == "names_local_paper_social_media"

gen recognition_a_2 = 0 if q02_c1_recognition == "none"
replace recognition_a_2 = 1 if q02_c1_recognition == "recognition_seals_pasted"
replace recognition_a_2 = 2 if q02_c1_recognition == "plaque_honour"
replace recognition_a_2 = 3 if q02_c1_recognition == "names_announced_local_radio"
replace recognition_a_2 = 4 if q02_c1_recognition == "names_local_paper_social_media"

gen recognition_b_2 = 0 if q02_c2_recognition == "none"
replace recognition_b_2 = 1 if q02_c2_recognition == "recognition_seals_pasted"
replace recognition_b_2 = 2 if q02_c2_recognition == "plaque_honour"
replace recognition_b_2 = 3 if q02_c2_recognition == "names_announced_local_radio"
replace recognition_b_2 = 4 if q02_c2_recognition == "names_local_paper_social_media"

gen recognition_a_3 = 0 if q03_c1_recognition == "none"
replace recognition_a_3 = 1 if q03_c1_recognition == "recognition_seals_pasted"
replace recognition_a_3 = 2 if q03_c1_recognition == "plaque_honour"
replace recognition_a_3 = 3 if q03_c1_recognition == "names_announced_local_radio"
replace recognition_a_3 = 4 if q03_c1_recognition == "names_local_paper_social_media"

gen recognition_b_3 = 0 if q03_c2_recognition == "none"
replace recognition_b_3 = 1 if q03_c2_recognition == "recognition_seals_pasted"
replace recognition_b_3 = 2 if q03_c2_recognition == "plaque_honour"
replace recognition_b_3 = 3 if q03_c2_recognition == "names_announced_local_radio"
replace recognition_b_3 = 4 if q03_c2_recognition == "names_local_paper_social_media"


reshape long evaluation_ admin_ collects_ purpose_ improvement_ beneficiary_ recognition_, i(id) j(card) string 

label variable admin_ "Tax authority"
label define admin_ 0 "central government" 1 "municipal government", modify
label values admin_ admin_

label variable collects_ "Tax collector"
label define collects_ 0 "bureaucrats" 1 "community leaders" 2"local church" 3"local ngos" 4 "foreign ngos", modify
label values collects_ collects_

label variable purpose_ "Tax earmarking"
label define purpose_ 0 "welfare" 1 "public security" 2"infrastructure" 3"waste collection" 4 "water & sanitation", modify
label values purpose_ purpose_

label variable improvement_ "Time"
label define improvement_ 0 "immediately" 1 "1 year" 2"2 years" 3"5 years" 4 "10 years", modify
label values improvement_ improvement_

label variable beneficiary_ "Beneficiary"
label define beneficiary_ 0 "extremely poor" 1 "poor" 2 "poor & lower middle class" 3 "poor & middle class" 4 "everyone", modify
label values beneficiary_ beneficiary_

label variable recognition_  "Recognition"
label define recognition_ 0 "none" 1 "outside seals" 2"plaques of honour" 3"local radio" 4 "social media", modify
label values recognition_ recognition_


save "haiti_conjoint.dta", replace





